package com.stormrage.edu.serv.adm.impl;

import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.stormrage.edu.dao.adm.AdmAcctResDao;
import com.stormrage.edu.serv.adm.AdmAcctResServ;
import com.stormrage.entity.adm.AdmAcctRes;
import com.stormragetech.core.exception.StormrageTechException;

/**
 * @Title: AdmAcctResServImpl.java
 * @Package com.stormrage.edu.serv.adm.impl
 * @Description: 管理员权限 Service
 * @author www.stormragetech.com
 * @date 2016年4月23日
 * @version V1.0
 */
@Service
public class AdmAcctResServImpl implements AdmAcctResServ {

	private static final Logger logger = LoggerFactory.getLogger(AdmAcctServImpl.class);

	@Autowired
	private AdmAcctResDao admAcctResDao;

	@Override
	public Integer create(final AdmAcctRes arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 AdmAcctResServ 】- 【 create 】-【 STARTED 】");

		Integer index = admAcctResDao.create(arg0);

		logger.debug(" 【 Serv 】- 【 AdmAcctResServ 】- 【 create 】-【 COMPLETED 】");
		return index;

	}

	@Override
	public void deleteByAcctId(Integer arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 AdmAcctResServ 】- 【 deleteByAcctId 】-【 STARTED 】");

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("acctId", arg0);

		admAcctResDao.deleteByAcctId(map);

		logger.debug(" 【 Serv 】- 【 AdmAcctResServ 】- 【 deleteByAcctId 】-【 COMPLETED 】");

	}

}
